-- do nothing function:
function http_post( req, uri ) end

function http_get( req, uri )
	-- any HTTP GET request will start the testing, the result
	-- is sent back in the response
	addBody(req,tester())
end

-- test the lua query interface
function dump_response(r)
	print("r count: "..#r)
	for k,v in pairs(r) do
		for k2,v2 in pairs(v) do print(k2,v2) end
	end
end
function tester()
	r = query( "DELETE * FROM test_domain;", {} )
	if #r ~= 1 then print("FAILURE") return end
	if r[1]["result"] ~= "ok" then dump_response(r) return "FAILURE" end

	-- dump_response(r)


	r = query( "INSERT INTO test_domain VALUES( first_name:$first_name, last_name:$last_name );", { {["first_name"]="grant", ["last_name"]="jones" }} )
	if #r ~= 1 then print("FAILURE") return end
	if r[1]["result"] ~= "ok" then dump_response(r) return "FAILURE" end
	-- dump_response(r)


	r = query( "SELECT * FROM test_domain;", { } )
	if #r ~= 1 then print("FAILURE") return end
	if r[1]["first_name"] ~= "grant" then dump_response(r) return "FAILURE" end
	-- dump_response(r)

	return "OK"
end



